package com.example.controller;

import com.example.pojo.OperateLog;
import com.example.pojo.OperateLogQueryParam;
import com.example.pojo.PageResult;
import com.example.pojo.Result;
import com.example.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/log")
public class OperateLogController {

    @Autowired
    private OperateLogService logService;

    /**
     * 分页查询操作日志
     */
    @GetMapping("/page")
    public Result page(OperateLogQueryParam operateLogQueryParam) {
        log.info("分页查询操作日志: {}", operateLogQueryParam);
        PageResult<OperateLog> page = logService.page(operateLogQueryParam);

        return Result.success(page);
    }

}
